package com.example.rjb_shoping.service.impl;

import com.example.rjb_shoping.entity.RjbClassiflcation;
import com.example.rjb_shoping.dao.RjbClassiflcationDao;
import com.example.rjb_shoping.service.RjbClassiflcationService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * (RjbClassiflcation)表服务实现类
 *
 * @author makejava
 * @since 2021-06-09 20:42:36
 */
@Service("rjbClassiflcationService")
public class RjbClassiflcationServiceImpl implements RjbClassiflcationService {
    @Resource
    private RjbClassiflcationDao rjbClassiflcationDao;

    @Override
    public RjbClassiflcation queryById(Integer cId) {
        return this.rjbClassiflcationDao.queryById(cId);
    }

    @Override
    public List<RjbClassiflcation> queryAllByLimit(int offset, int limit) {
        return this.rjbClassiflcationDao.queryAllByLimit(offset, limit);
    }

    @Override
    public RjbClassiflcation insert(RjbClassiflcation rjbClassiflcation) {
        this.rjbClassiflcationDao.insert(rjbClassiflcation);
        return rjbClassiflcation;
    }

    @Override
    public RjbClassiflcation update(RjbClassiflcation rjbClassiflcation) {
        this.rjbClassiflcationDao.update(rjbClassiflcation);
        return this.queryById(rjbClassiflcation.getCId());
    }

    @Override
    public boolean deleteById(Integer cId) {
        return this.rjbClassiflcationDao.deleteById(cId) > 0;
    }
}
